package pt.mauromad.guias.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/menu")
public class MenuController extends BaseController {
	@RequestMapping(value = "/my-profile")
	public String myProfile() {
		return redirect("/user/%s", getUsername());
	}

	@RequestMapping(value = "/my-account")
	public String myAccount() {
		return redirect("/account/%s", getDomain().getDomain());
	}

	@RequestMapping(value = "/my-manifests")
	public String myManifests() {
		return redirect("/manifests/user/%s", getUsername());
	}

	@RequestMapping(value = "/all-accounts")
	public String allAccounts() {
		return redirect("/admin/account/all");
	}

	@RequestMapping(value = "/all-domains")
	public String allDomains() {
		return redirect("/admin/domain/all");
	}

	@RequestMapping(value = "/all-roles")
	public String allRoles() {
		return redirect("/admin/role/all");
	}

	@RequestMapping(value = "/all-users")
	public String allUsers() {
		return redirect("/user/all", getDomain());
	}

	@RequestMapping(value = "/all-companies")
	public String allCompanies() {
		return redirect("/company/all");
	}

	@RequestMapping(value = "/all-manifests")
	public String allManifests() {
		return redirect("/manifest/all");
	}

	@RequestMapping(value = "/new-manifest")
	public String newManifest() {
		return redirect("/manifest/new");
	}

	@RequestMapping(value = "/new-company")
	public String newCompany() {
		return redirect("/company/new");
	}

	@RequestMapping(value = "/new-user")
	public String newUser() {
		return redirect("/user/new/account/%s", getAccount());
	}

	@RequestMapping(value = "/new-account")
	public String newAccount() {
		return redirect("/admin/account/new");
	}

	@RequestMapping(value = "/new-product")
	public String newProduct() {
		return redirect("/product/new");
	}

	@RequestMapping(value = "/new-domain")
	public String newDomain() {
		return redirect("/admin/domain/new");
	}
}
